.class public Lcom/nemustech/tiffany/world/TFCube;
.super Lcom/nemustech/tiffany/world/TFModel;
.source "TFCube.java"


# static fields
.field static final TAG:Ljava/lang/String; = "TFCube"

.field private static mMirrorY:F

.field private static mObjectY:F


# direct methods
.method public constructor <init>(FF)V
    .locals 0
    .parameter "width"
    .parameter "height"

    .prologue
    .line 45
    invoke-direct {p0, p1, p2, p1}, Lcom/nemustech/tiffany/world/TFCube;-><init>(FFF)V

    .line 46
    return-void
.end method

.method public constructor <init>(FFF)V
    .locals 2
    .parameter "width"
    .parameter "height"
    .parameter "depth"

    .prologue
    .line 35
    invoke-direct {p0}, Lcom/nemustech/tiffany/world/TFModel;-><init>()V

    .line 36
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFCube;->mTextures:Lcom/nemustech/tiffany/world/TFTextures;

    const/4 v1, 0x6

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFTextures;->setNumFaces(I)V

    .line 37
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/nemustech/tiffany/world/TFCube;->setBackFaceVisibility(Z)V

    .line 38
    invoke-virtual {p0, p1, p2, p3}, Lcom/nemustech/tiffany/world/TFCube;->setSize(FFF)V

    .line 39
    return-void
.end method

.method public constructor <init>(Lcom/nemustech/tiffany/world/TFWorld;FF)V
    .locals 0
    .parameter "world"
    .parameter "width"
    .parameter "height"

    .prologue
    .line 26
    invoke-direct {p0, p1, p2, p3, p2}, Lcom/nemustech/tiffany/world/TFCube;-><init>(Lcom/nemustech/tiffany/world/TFWorld;FFF)V

    .line 27
    return-void
.end method

.method public constructor <init>(Lcom/nemustech/tiffany/world/TFWorld;FFF)V
    .locals 0
    .parameter "world"
    .parameter "width"
    .parameter "height"
    .parameter "depth"

    .prologue
    .line 56
    invoke-direct {p0, p2, p3, p4}, Lcom/nemustech/tiffany/world/TFCube;-><init>(FFF)V

    .line 57
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFCube;->attachTo(Lcom/nemustech/tiffany/world/TFWorld;)V

    .line 58
    return-void
.end method

.method private prvEffectLookFront(I)V
    .locals 8
    .parameter "selectedIndex"

    .prologue
    const/high16 v7, 0x4334

    const/high16 v6, 0x4387

    const/4 v5, 0x1

    const/4 v4, 0x0

    const/4 v3, 0x0

    .line 294
    const v0, 0x3e8fdf3b

    .line 295
    .local v0, rotationSpeed:F
    const/4 v2, 0x3

    new-array v1, v2, [F

    .line 297
    .local v1, targetAngle:[F
    packed-switch p1, :pswitch_data_0

    .line 301
    aput v3, v1, v4

    .line 302
    aput v3, v1, v5

    .line 303
    const/4 v2, 0x2

    aput v3, v1, v2

    .line 327
    :goto_0
    aget v2, v1, v4

    aget v3, v1, v5

    const v4, 0x3e8fdf3b

    const/4 v5, 0x2

    invoke-super {p0, v2, v3, v4, v5}, Lcom/nemustech/tiffany/world/TFModel;->rotate(FFFI)V

    .line 328
    return-void

    .line 306
    :pswitch_0
    aput v7, v1, v4

    .line 307
    aput v3, v1, v5

    goto :goto_0

    .line 310
    :pswitch_1
    const/high16 v2, 0x42b4

    aput v2, v1, v4

    .line 311
    aput v3, v1, v5

    goto :goto_0

    .line 314
    :pswitch_2
    aput v6, v1, v4

    .line 315
    aput v3, v1, v5

    goto :goto_0

    .line 318
    :pswitch_3
    aput v7, v1, v4

    .line 319
    aput v6, v1, v5

    goto :goto_0

    .line 322
    :pswitch_4
    aput v3, v1, v4

    .line 323
    aput v6, v1, v5

    goto :goto_0

    .line 297
    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_3
        :pswitch_4
    .end packed-switch
.end method


# virtual methods
.method adjustTextureCoordination(Landroid/graphics/Rect;III)V
    .locals 7
    .parameter "rectTexture"
    .parameter "index"
    .parameter "textureWidth"
    .parameter "textureHeight"

    .prologue
    .line 105
    const/4 v1, 0x0

    .line 106
    .local v1, newLeft:F
    const/4 v3, 0x0

    .line 108
    .local v3, newTop:F
    iget v5, p1, Landroid/graphics/Rect;->right:I

    int-to-float v5, v5

    int-to-float v6, p3

    div-float v2, v5, v6

    .line 109
    .local v2, newRight:F
    iget v5, p1, Landroid/graphics/Rect;->bottom:I

    int-to-float v5, v5

    int-to-float v6, p4

    div-float v0, v5, v6

    .line 110
    .local v0, newBottom:F
    const/16 v5, 0x8

    new-array v4, v5, [F

    .line 112
    .local v4, texCoords:[F
    packed-switch p2, :pswitch_data_0

    .line 157
    :goto_0
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFModel;->mTextureBuffer:Ljava/nio/FloatBuffer;

    mul-int/lit8 v6, p2, 0x8

    invoke-virtual {v5, v6}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 158
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFModel;->mTextureBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v5, v4}, Ljava/nio/FloatBuffer;->put([F)Ljava/nio/FloatBuffer;

    .line 159
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFModel;->mTextureBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v5}, Ljava/nio/FloatBuffer;->rewind()Ljava/nio/Buffer;

    .line 160
    return-void

    .line 114
    :pswitch_0
    const/4 v5, 0x0

    aput v1, v4, v5

    .line 115
    const/4 v5, 0x1

    aput v0, v4, v5

    .line 116
    const/4 v5, 0x2

    aput v2, v4, v5

    .line 117
    const/4 v5, 0x3

    aput v0, v4, v5

    .line 118
    const/4 v5, 0x4

    aput v1, v4, v5

    .line 119
    const/4 v5, 0x5

    aput v3, v4, v5

    .line 120
    const/4 v5, 0x6

    aput v2, v4, v5

    .line 121
    const/4 v5, 0x7

    aput v3, v4, v5

    goto :goto_0

    .line 126
    :pswitch_1
    const/4 v5, 0x0

    aput v2, v4, v5

    .line 127
    const/4 v5, 0x1

    aput v0, v4, v5

    .line 128
    const/4 v5, 0x2

    aput v2, v4, v5

    .line 129
    const/4 v5, 0x3

    aput v3, v4, v5

    .line 130
    const/4 v5, 0x4

    aput v1, v4, v5

    .line 131
    const/4 v5, 0x5

    aput v0, v4, v5

    .line 132
    const/4 v5, 0x6

    aput v1, v4, v5

    .line 133
    const/4 v5, 0x7

    aput v3, v4, v5

    goto :goto_0

    .line 136
    :pswitch_2
    const/4 v5, 0x0

    aput v2, v4, v5

    .line 137
    const/4 v5, 0x1

    aput v3, v4, v5

    .line 138
    const/4 v5, 0x2

    aput v1, v4, v5

    .line 139
    const/4 v5, 0x3

    aput v3, v4, v5

    .line 140
    const/4 v5, 0x4

    aput v2, v4, v5

    .line 141
    const/4 v5, 0x5

    aput v0, v4, v5

    .line 142
    const/4 v5, 0x6

    aput v1, v4, v5

    .line 143
    const/4 v5, 0x7

    aput v0, v4, v5

    goto :goto_0

    .line 146
    :pswitch_3
    const/4 v5, 0x0

    aput v1, v4, v5

    .line 147
    const/4 v5, 0x1

    aput v3, v4, v5

    .line 148
    const/4 v5, 0x2

    aput v1, v4, v5

    .line 149
    const/4 v5, 0x3

    aput v0, v4, v5

    .line 150
    const/4 v5, 0x4

    aput v2, v4, v5

    .line 151
    const/4 v5, 0x5

    aput v3, v4, v5

    .line 152
    const/4 v5, 0x6

    aput v2, v4, v5

    .line 153
    const/4 v5, 0x7

    aput v0, v4, v5

    goto :goto_0

    .line 112
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
        :pswitch_1
        :pswitch_1
        :pswitch_2
        :pswitch_3
    .end packed-switch
.end method

.method getHitFace([F)I
    .locals 2
    .parameter "near"

    .prologue
    .line 435
    invoke-super {p0, p1}, Lcom/nemustech/tiffany/world/TFModel;->getHitFace([F)I

    move-result v0

    .line 436
    .local v0, face:I
    if-gez v0, :cond_0

    move v1, v0

    .line 438
    :goto_0
    return v1

    :cond_0
    iget v1, p0, Lcom/nemustech/tiffany/world/TFCube;->mHitFace:I

    goto :goto_0
.end method

.method protected onCalcReflection(Ljavax/microedition/khronos/opengles/GL10;F)V
    .locals 7
    .parameter "gl"
    .parameter "y"

    .prologue
    const/4 v6, 0x0

    const/high16 v5, 0x3f80

    const/4 v4, 0x0

    .line 362
    invoke-interface {p1}, Ljavax/microedition/khronos/opengles/GL10;->glLoadIdentity()V

    .line 363
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFCube;->mLocation:[F

    aget v0, v0, v6

    const/high16 v1, 0x4000

    mul-float/2addr v1, p2

    iget v2, p0, Lcom/nemustech/tiffany/world/TFCube;->mHeight:F

    add-float/2addr v1, v2

    neg-float v1, v1

    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFCube;->mLocation:[F

    const/4 v3, 0x2

    aget v2, v2, v3

    invoke-interface {p1, v0, v1, v2}, Ljavax/microedition/khronos/opengles/GL10;->glTranslatef(FFF)V

    .line 364
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFCube;->mAngle:[F

    aget v0, v0, v6

    invoke-interface {p1, v0, v4, v5, v4}, Ljavax/microedition/khronos/opengles/GL10;->glRotatef(FFFF)V

    .line 365
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFCube;->mAngle:[F

    const/4 v1, 0x1

    aget v0, v0, v1

    neg-float v0, v0

    invoke-interface {p1, v0, v5, v4, v4}, Ljavax/microedition/khronos/opengles/GL10;->glRotatef(FFFF)V

    .line 366
    const/high16 v0, -0x4080

    invoke-interface {p1, v5, v0, v5}, Ljavax/microedition/khronos/opengles/GL10;->glScalef(FFF)V

    .line 367
    return-void
.end method

.method protected onCullFace(IZ)I
    .locals 1
    .parameter "index"
    .parameter "reflection"

    .prologue
    .line 357
    if-eqz p2, :cond_0

    const/16 v0, 0x404

    :goto_0
    return v0

    :cond_0
    const/16 v0, 0x405

    goto :goto_0
.end method

.method protected onTouchDrag(FFFFI)V
    .locals 18
    .parameter "start_x"
    .parameter "start_y"
    .parameter "end_x"
    .parameter "end_y"
    .parameter "tickPassed"

    .prologue
    .line 237
    invoke-virtual/range {p0 .. p5}, Lcom/nemustech/tiffany/world/TFCube;->calcForce(FFFFI)V

    .line 239
    const/4 v5, 0x4

    .line 240
    .local v5, VERTEX_NUM_OF_POLYGON:I
    const/16 v15, 0x8

    new-array v14, v15, [F

    .line 241
    .local v14, vertices:[F
    const/4 v15, 0x1

    new-array v13, v15, [F

    .line 243
    .local v13, near:[F
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v15, v0

    iget-object v15, v15, Lcom/nemustech/tiffany/world/TFWorld;->mRenderer:Lcom/nemustech/tiffany/world/TFRenderer;

    move-object v0, v15

    move-object/from16 v1, p0

    move/from16 v2, p3

    move/from16 v3, p4

    move-object v4, v13

    invoke-virtual {v0, v1, v2, v3, v4}, Lcom/nemustech/tiffany/world/TFRenderer;->getSelectedFaceIndex(Lcom/nemustech/tiffany/world/TFModel;FF[F)I

    move-result v8

    .line 244
    .local v8, face_index:I
    if-ltz v8, :cond_0

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v15, v0

    iget-object v15, v15, Lcom/nemustech/tiffany/world/TFWorld;->mRenderer:Lcom/nemustech/tiffany/world/TFRenderer;

    move-object v0, v15

    move-object/from16 v1, p0

    move v2, v8

    move-object v3, v14

    invoke-virtual {v0, v1, v2, v3}, Lcom/nemustech/tiffany/world/TFRenderer;->getFaceVertices(Lcom/nemustech/tiffany/world/TFModel;I[F)V

    .line 246
    :cond_0
    const/4 v11, 0x0

    .line 247
    .local v11, max:F
    const/4 v15, 0x0

    aget v15, v14, v15

    const/16 v16, 0x2

    aget v16, v14, v16

    invoke-static/range {v15 .. v16}, Ljava/lang/Math;->max(FF)F

    move-result v11

    .line 248
    const/4 v15, 0x4

    aget v15, v14, v15

    invoke-static {v11, v15}, Ljava/lang/Math;->max(FF)F

    move-result v11

    .line 249
    const/4 v15, 0x6

    aget v15, v14, v15

    invoke-static {v11, v15}, Ljava/lang/Math;->max(FF)F

    move-result v11

    .line 251
    const/4 v12, 0x0

    .line 252
    .local v12, min:F
    const/4 v15, 0x0

    aget v15, v14, v15

    const/16 v16, 0x2

    aget v16, v14, v16

    invoke-static/range {v15 .. v16}, Ljava/lang/Math;->min(FF)F

    move-result v12

    .line 253
    const/4 v15, 0x4

    aget v15, v14, v15

    invoke-static {v12, v15}, Ljava/lang/Math;->min(FF)F

    move-result v12

    .line 254
    const/4 v15, 0x6

    aget v15, v14, v15

    invoke-static {v12, v15}, Ljava/lang/Math;->min(FF)F

    move-result v12

    .line 256
    sub-float v15, v11, v12

    const/high16 v16, 0x4000

    div-float v15, v15, v16

    add-float v7, v12, v15

    .line 261
    .local v7, base:F
    const/4 v6, 0x0

    .line 263
    .local v6, bSpinUpward:Z
    const/4 v15, 0x2

    if-eq v8, v15, :cond_1

    const/4 v15, 0x3

    if-ne v8, v15, :cond_4

    .line 264
    :cond_1
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mAngle:[F

    move-object v15, v0

    const/16 v16, 0x0

    aget v15, v15, v16

    const/high16 v16, 0x4334

    cmpl-float v15, v15, v16

    if-ltz v15, :cond_3

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mAngle:[F

    move-object v15, v0

    const/16 v16, 0x0

    aget v15, v15, v16

    const/high16 v16, 0x43b4

    cmpg-float v15, v15, v16

    if-gez v15, :cond_3

    .line 265
    cmpg-float v15, p1, v7

    if-gtz v15, :cond_2

    .line 266
    const/4 v6, 0x1

    .line 278
    :cond_2
    :goto_0
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFModel;->mForceFromSide:F

    move v15, v0

    const/high16 v16, 0x40a0

    mul-float v9, v15, v16

    .line 279
    .local v9, forceX:F
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFModel;->mForceFromHead:F

    move v15, v0

    const/high16 v16, 0x40a0

    mul-float v10, v15, v16

    .line 281
    .local v10, forceY:F
    if-eqz v6, :cond_6

    move v15, v10

    :goto_1
    const/16 v16, 0x0

    const/16 v17, 0x0

    move-object/from16 v0, p0

    move v1, v9

    move v2, v15

    move/from16 v3, v16

    move/from16 v4, v17

    invoke-virtual {v0, v1, v2, v3, v4}, Lcom/nemustech/tiffany/world/TFCube;->spin(FFFZ)V

    .line 282
    return-void

    .line 270
    .end local v9           #forceX:F
    .end local v10           #forceY:F
    :cond_3
    cmpl-float v15, p1, v7

    if-ltz v15, :cond_2

    .line 271
    const/4 v6, 0x1

    goto :goto_0

    .line 274
    :cond_4
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mAngle:[F

    move-object v15, v0

    const/16 v16, 0x0

    aget v15, v15, v16

    const/high16 v16, 0x42b4

    cmpg-float v15, v15, v16

    if-ltz v15, :cond_5

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mAngle:[F

    move-object v15, v0

    const/16 v16, 0x0

    aget v15, v15, v16

    const/high16 v16, 0x4387

    cmpl-float v15, v15, v16

    if-lez v15, :cond_2

    .line 275
    :cond_5
    const/4 v6, 0x1

    goto :goto_0

    .line 281
    .restart local v9       #forceX:F
    .restart local v10       #forceY:F
    :cond_6
    neg-float v15, v10

    goto :goto_1
.end method

.method public setImageResource(Landroid/content/res/Resources;[I)Lcom/nemustech/tiffany/world/TFError;
    .locals 3
    .parameter "resources"
    .parameter "resource_id"

    .prologue
    .line 73
    array-length v1, p2

    const/4 v2, 0x6

    if-le v1, v2, :cond_0

    sget-object v1, Lcom/nemustech/tiffany/world/TFError;->INVALID_PARAM:Lcom/nemustech/tiffany/world/TFError;

    .line 78
    :goto_0
    return-object v1

    .line 75
    :cond_0
    const/4 v0, 0x0

    .local v0, i:I
    :goto_1
    array-length v1, p2

    if-ge v0, v1, :cond_1

    .line 76
    aget v1, p2, v0

    invoke-super {p0, v0, p1, v1}, Lcom/nemustech/tiffany/world/TFModel;->setImageResource(ILandroid/content/res/Resources;I)Lcom/nemustech/tiffany/world/TFError;

    .line 75
    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    .line 78
    :cond_1
    sget-object v1, Lcom/nemustech/tiffany/world/TFError;->ERROR_NONE:Lcom/nemustech/tiffany/world/TFError;

    goto :goto_0
.end method

.method public setImageResource([Landroid/graphics/Bitmap;Landroid/graphics/Rect;)Lcom/nemustech/tiffany/world/TFError;
    .locals 3
    .parameter "bmp"
    .parameter "rectSet"

    .prologue
    .line 94
    array-length v1, p1

    const/4 v2, 0x6

    if-le v1, v2, :cond_0

    sget-object v1, Lcom/nemustech/tiffany/world/TFError;->INVALID_PARAM:Lcom/nemustech/tiffany/world/TFError;

    .line 99
    :goto_0
    return-object v1

    .line 96
    :cond_0
    const/4 v0, 0x0

    .local v0, i:I
    :goto_1
    array-length v1, p1

    if-ge v0, v1, :cond_1

    .line 97
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFCube;->mTextures:Lcom/nemustech/tiffany/world/TFTextures;

    aget-object v2, p1, v0

    invoke-virtual {v1, v0, v2, p2}, Lcom/nemustech/tiffany/world/TFTextures;->setImageResource(ILandroid/graphics/Bitmap;Landroid/graphics/Rect;)Z

    .line 96
    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    .line 99
    :cond_1
    sget-object v1, Lcom/nemustech/tiffany/world/TFError;->ERROR_NONE:Lcom/nemustech/tiffany/world/TFError;

    goto :goto_0
.end method

.method public setSize(FFF)V
    .locals 11
    .parameter "width"
    .parameter "height"
    .parameter "depth"

    .prologue
    const/16 v10, 0x30

    const/4 v9, 0x0

    const/high16 v7, 0x4000

    .line 172
    iput p1, p0, Lcom/nemustech/tiffany/world/TFCube;->mWidth:F

    .line 173
    iput p2, p0, Lcom/nemustech/tiffany/world/TFCube;->mHeight:F

    .line 174
    iput p3, p0, Lcom/nemustech/tiffany/world/TFCube;->mDepth:F

    .line 176
    div-float v6, p1, v7

    .line 177
    .local v6, w:F
    div-float v1, p2, v7

    .line 178
    .local v1, h:F
    div-float v0, p3, v7

    .line 179
    .local v0, d:F
    const/16 v7, 0x48

    new-array v5, v7, [F

    neg-float v7, v6

    aput v7, v5, v9

    const/4 v7, 0x1

    neg-float v8, v1

    aput v8, v5, v7

    const/4 v7, 0x2

    aput v0, v5, v7

    const/4 v7, 0x3

    aput v6, v5, v7

    const/4 v7, 0x4

    neg-float v8, v1

    aput v8, v5, v7

    const/4 v7, 0x5

    aput v0, v5, v7

    const/4 v7, 0x6

    neg-float v8, v6

    aput v8, v5, v7

    const/4 v7, 0x7

    aput v1, v5, v7

    const/16 v7, 0x8

    aput v0, v5, v7

    const/16 v7, 0x9

    aput v6, v5, v7

    const/16 v7, 0xa

    aput v1, v5, v7

    const/16 v7, 0xb

    aput v0, v5, v7

    const/16 v7, 0xc

    neg-float v8, v6

    aput v8, v5, v7

    const/16 v7, 0xd

    neg-float v8, v1

    aput v8, v5, v7

    const/16 v7, 0xe

    neg-float v8, v0

    aput v8, v5, v7

    const/16 v7, 0xf

    neg-float v8, v6

    aput v8, v5, v7

    const/16 v7, 0x10

    aput v1, v5, v7

    const/16 v7, 0x11

    neg-float v8, v0

    aput v8, v5, v7

    const/16 v7, 0x12

    aput v6, v5, v7

    const/16 v7, 0x13

    neg-float v8, v1

    aput v8, v5, v7

    const/16 v7, 0x14

    neg-float v8, v0

    aput v8, v5, v7

    const/16 v7, 0x15

    aput v6, v5, v7

    const/16 v7, 0x16

    aput v1, v5, v7

    const/16 v7, 0x17

    neg-float v8, v0

    aput v8, v5, v7

    const/16 v7, 0x18

    neg-float v8, v6

    aput v8, v5, v7

    const/16 v7, 0x19

    neg-float v8, v1

    aput v8, v5, v7

    const/16 v7, 0x1a

    aput v0, v5, v7

    const/16 v7, 0x1b

    neg-float v8, v6

    aput v8, v5, v7

    const/16 v7, 0x1c

    aput v1, v5, v7

    const/16 v7, 0x1d

    aput v0, v5, v7

    const/16 v7, 0x1e

    neg-float v8, v6

    aput v8, v5, v7

    const/16 v7, 0x1f

    neg-float v8, v1

    aput v8, v5, v7

    const/16 v7, 0x20

    neg-float v8, v0

    aput v8, v5, v7

    const/16 v7, 0x21

    neg-float v8, v6

    aput v8, v5, v7

    const/16 v7, 0x22

    aput v1, v5, v7

    const/16 v7, 0x23

    neg-float v8, v0

    aput v8, v5, v7

    const/16 v7, 0x24

    aput v6, v5, v7

    const/16 v7, 0x25

    neg-float v8, v1

    aput v8, v5, v7

    const/16 v7, 0x26

    neg-float v8, v0

    aput v8, v5, v7

    const/16 v7, 0x27

    aput v6, v5, v7

    const/16 v7, 0x28

    aput v1, v5, v7

    const/16 v7, 0x29

    neg-float v8, v0

    aput v8, v5, v7

    const/16 v7, 0x2a

    aput v6, v5, v7

    const/16 v7, 0x2b

    neg-float v8, v1

    aput v8, v5, v7

    const/16 v7, 0x2c

    aput v0, v5, v7

    const/16 v7, 0x2d

    aput v6, v5, v7

    const/16 v7, 0x2e

    aput v1, v5, v7

    const/16 v7, 0x2f

    aput v0, v5, v7

    neg-float v7, v6

    aput v7, v5, v10

    const/16 v7, 0x31

    aput v1, v5, v7

    const/16 v7, 0x32

    aput v0, v5, v7

    const/16 v7, 0x33

    aput v6, v5, v7

    const/16 v7, 0x34

    aput v1, v5, v7

    const/16 v7, 0x35

    aput v0, v5, v7

    const/16 v7, 0x36

    neg-float v8, v6

    aput v8, v5, v7

    const/16 v7, 0x37

    aput v1, v5, v7

    const/16 v7, 0x38

    neg-float v8, v0

    aput v8, v5, v7

    const/16 v7, 0x39

    aput v6, v5, v7

    const/16 v7, 0x3a

    aput v1, v5, v7

    const/16 v7, 0x3b

    neg-float v8, v0

    aput v8, v5, v7

    const/16 v7, 0x3c

    neg-float v8, v6

    aput v8, v5, v7

    const/16 v7, 0x3d

    neg-float v8, v1

    aput v8, v5, v7

    const/16 v7, 0x3e

    aput v0, v5, v7

    const/16 v7, 0x3f

    neg-float v8, v6

    aput v8, v5, v7

    const/16 v7, 0x40

    neg-float v8, v1

    aput v8, v5, v7

    const/16 v7, 0x41

    neg-float v8, v0

    aput v8, v5, v7

    const/16 v7, 0x42

    aput v6, v5, v7

    const/16 v7, 0x43

    neg-float v8, v1

    aput v8, v5, v7

    const/16 v7, 0x44

    aput v0, v5, v7

    const/16 v7, 0x45

    aput v6, v5, v7

    const/16 v7, 0x46

    neg-float v8, v1

    aput v8, v5, v7

    const/16 v7, 0x47

    neg-float v8, v0

    aput v8, v5, v7

    .line 199
    .local v5, vertices:[F
    new-array v3, v10, [F

    fill-array-data v3, :array_0

    .line 219
    .local v3, texCoords:[F
    array-length v7, v5

    mul-int/lit8 v7, v7, 0x4

    invoke-static {v7}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;

    move-result-object v4

    .line 220
    .local v4, vbb:Ljava/nio/ByteBuffer;
    invoke-static {}, Ljava/nio/ByteOrder;->nativeOrder()Ljava/nio/ByteOrder;

    move-result-object v7

    invoke-virtual {v4, v7}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;

    .line 221
    invoke-virtual {v4}, Ljava/nio/ByteBuffer;->asFloatBuffer()Ljava/nio/FloatBuffer;

    move-result-object v7

    iput-object v7, p0, Lcom/nemustech/tiffany/world/TFModel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    .line 222
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFModel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v7, v5}, Ljava/nio/FloatBuffer;->put([F)Ljava/nio/FloatBuffer;

    .line 223
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFModel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v7, v9}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 226
    array-length v7, v3

    mul-int/lit8 v7, v7, 0x4

    invoke-static {v7}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;

    move-result-object v2

    .line 227
    .local v2, tbb:Ljava/nio/ByteBuffer;
    invoke-static {}, Ljava/nio/ByteOrder;->nativeOrder()Ljava/nio/ByteOrder;

    move-result-object v7

    invoke-virtual {v2, v7}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;

    .line 228
    invoke-virtual {v2}, Ljava/nio/ByteBuffer;->asFloatBuffer()Ljava/nio/FloatBuffer;

    move-result-object v7

    iput-object v7, p0, Lcom/nemustech/tiffany/world/TFModel;->mTextureBuffer:Ljava/nio/FloatBuffer;

    .line 229
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFModel;->mTextureBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v7, v3}, Ljava/nio/FloatBuffer;->put([F)Ljava/nio/FloatBuffer;

    .line 230
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFModel;->mTextureBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v7, v9}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 232
    return-void

    .line 199
    :array_0
    .array-data 0x4
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x80t 0x3ft
        0x0t 0x0t 0x80t 0x3ft
    .end array-data
.end method

.method public setWeight(F)V
    .locals 2
    .parameter "weight"

    .prologue
    .line 287
    const/high16 v0, 0x4000

    div-float v0, p1, v0

    invoke-super {p0, v0}, Lcom/nemustech/tiffany/world/TFModel;->setWeight(F)V

    .line 288
    iget v0, p0, Lcom/nemustech/tiffany/world/TFCube;->mRotationResistency:F

    const/high16 v1, 0x4080

    mul-float/2addr v0, v1

    iput v0, p0, Lcom/nemustech/tiffany/world/TFCube;->mRotationResistency:F

    .line 289
    return-void
.end method

.method public showEffect(II)V
    .locals 1
    .parameter "effectID"
    .parameter "targetIndex"

    .prologue
    .line 334
    packed-switch p1, :pswitch_data_0

    .line 353
    :goto_0
    return-void

    .line 338
    :pswitch_0
    invoke-direct {p0, p2}, Lcom/nemustech/tiffany/world/TFCube;->prvEffectLookFront(I)V

    .line 339
    new-instance v0, Lcom/nemustech/tiffany/world/TFCube$1;

    invoke-direct {v0, p0}, Lcom/nemustech/tiffany/world/TFCube$1;-><init>(Lcom/nemustech/tiffany/world/TFCube;)V

    invoke-virtual {p0, v0}, Lcom/nemustech/tiffany/world/TFCube;->setEffectFinishListener(Lcom/nemustech/tiffany/world/TFWorld$OnEffectFinishListener;)V

    goto :goto_0

    .line 347
    :pswitch_1
    invoke-super {p0, p1, p2}, Lcom/nemustech/tiffany/world/TFModel;->showEffect(II)V

    goto :goto_0

    .line 334
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method

.method updateHitPoint()V
    .locals 22

    .prologue
    .line 375
    invoke-super/range {p0 .. p0}, Lcom/nemustech/tiffany/world/TFModel;->updateHitPoint()V

    .line 377
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mWidth:F

    move v3, v0

    const/high16 v4, 0x4000

    div-float v16, v3, v4

    .line 378
    .local v16, xCoord:F
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mHeight:F

    move v3, v0

    const/high16 v4, 0x4000

    div-float v18, v3, v4

    .line 379
    .local v18, yCoord:F
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mDepth:F

    move v3, v0

    const/high16 v4, 0x4000

    div-float v20, v3, v4

    .line 380
    .local v20, zCoord:F
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mHitPoint:[F

    move-object v2, v0

    .line 382
    .local v2, m:[F
    const/4 v3, 0x6

    new-array v11, v3, [F

    const/4 v3, 0x0

    aput v20, v11, v3

    const/4 v3, 0x1

    move/from16 v0, v20

    neg-float v0, v0

    move v4, v0

    aput v4, v11, v3

    const/4 v3, 0x2

    move/from16 v0, v16

    neg-float v0, v0

    move v4, v0

    aput v4, v11, v3

    const/4 v3, 0x3

    aput v16, v11, v3

    const/4 v3, 0x4

    aput v18, v11, v3

    const/4 v3, 0x5

    move/from16 v0, v18

    neg-float v0, v0

    move v4, v0

    aput v4, v11, v3

    .line 390
    .local v11, hitTestCoord:[F
    const/4 v3, 0x6

    new-array v12, v3, [I

    fill-array-data v12, :array_0

    .line 399
    .local v12, hitTestPlane:[I
    const/high16 v15, 0x42c8

    .line 401
    .local v15, tMin:F
    const/4 v10, -0x1

    .line 402
    .local v10, face:I
    const/4 v13, 0x0

    .local v13, i:I
    :goto_0
    array-length v3, v11

    if-ge v13, v3, :cond_8

    .line 403
    const/4 v3, 0x0

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mHitTestLine:[F

    move-object v4, v0

    const/4 v5, 0x0

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mHitTestLine:[F

    move-object v6, v0

    const/4 v7, 0x4

    aget v8, v11, v13

    aget v9, v12, v13

    invoke-static/range {v2 .. v9}, Lcom/nemustech/tiffany/world/TFVector3D;->getPointOnLine([FI[FI[FIFI)F

    move-result v14

    .line 408
    .local v14, t:F
    aget v3, v12, v13

    if-eqz v3, :cond_0

    const/4 v3, 0x0

    aget v3, v2, v3

    move/from16 v0, v16

    neg-float v0, v0

    move v4, v0

    cmpl-float v3, v3, v4

    if-ltz v3, :cond_4

    const/4 v3, 0x0

    aget v3, v2, v3

    cmpg-float v3, v3, v16

    if-gtz v3, :cond_4

    :cond_0
    const/4 v3, 0x1

    move/from16 v17, v3

    .line 410
    .local v17, xRange:Z
    :goto_1
    aget v3, v12, v13

    const/4 v4, 0x1

    if-eq v3, v4, :cond_1

    const/4 v3, 0x1

    aget v3, v2, v3

    move/from16 v0, v18

    neg-float v0, v0

    move v4, v0

    cmpl-float v3, v3, v4

    if-ltz v3, :cond_5

    const/4 v3, 0x1

    aget v3, v2, v3

    cmpg-float v3, v3, v18

    if-gtz v3, :cond_5

    :cond_1
    const/4 v3, 0x1

    move/from16 v19, v3

    .line 412
    .local v19, yRange:Z
    :goto_2
    aget v3, v12, v13

    const/4 v4, 0x2

    if-eq v3, v4, :cond_2

    const/4 v3, 0x2

    aget v3, v2, v3

    move/from16 v0, v20

    neg-float v0, v0

    move v4, v0

    cmpl-float v3, v3, v4

    if-ltz v3, :cond_6

    const/4 v3, 0x2

    aget v3, v2, v3

    cmpg-float v3, v3, v20

    if-gtz v3, :cond_6

    :cond_2
    const/4 v3, 0x1

    move/from16 v21, v3

    .line 414
    .local v21, zRange:Z
    :goto_3
    if-eqz v17, :cond_3

    if-eqz v19, :cond_3

    if-nez v21, :cond_7

    .line 402
    :cond_3
    :goto_4
    add-int/lit8 v13, v13, 0x1

    goto :goto_0

    .line 408
    .end local v17           #xRange:Z
    .end local v19           #yRange:Z
    .end local v21           #zRange:Z
    :cond_4
    const/4 v3, 0x0

    move/from16 v17, v3

    goto :goto_1

    .line 410
    .restart local v17       #xRange:Z
    :cond_5
    const/4 v3, 0x0

    move/from16 v19, v3

    goto :goto_2

    .line 412
    .restart local v19       #yRange:Z
    :cond_6
    const/4 v3, 0x0

    move/from16 v21, v3

    goto :goto_3

    .line 417
    .restart local v21       #zRange:Z
    :cond_7
    cmpg-float v3, v14, v15

    if-gez v3, :cond_3

    .line 418
    move v15, v14

    .line 419
    move v10, v13

    goto :goto_4

    .line 423
    .end local v14           #t:F
    .end local v17           #xRange:Z
    .end local v19           #yRange:Z
    .end local v21           #zRange:Z
    :cond_8
    if-gez v10, :cond_9

    .line 432
    :goto_5
    return-void

    .line 426
    :cond_9
    const/4 v3, 0x0

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mHitTestLine:[F

    move-object v4, v0

    const/4 v5, 0x0

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mHitTestLine:[F

    move-object v6, v0

    const/4 v7, 0x4

    aget v8, v11, v10

    aget v9, v12, v10

    invoke-static/range {v2 .. v9}, Lcom/nemustech/tiffany/world/TFVector3D;->getPointOnLine([FI[FI[FIFI)F

    .line 429
    const/4 v3, 0x0

    invoke-static {v2, v3}, Lcom/nemustech/tiffany/world/TFVector3D;->setW([FI)V

    .line 430
    const/4 v3, 0x4

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFCube;->mMatrix:[F

    move-object v4, v0

    const/4 v5, 0x0

    const/4 v7, 0x0

    move-object v6, v2

    invoke-static/range {v2 .. v7}, Landroid/opengl/Matrix;->multiplyMV([FI[FI[FI)V

    .line 431
    move v0, v10

    move-object/from16 v1, p0

    iput v0, v1, Lcom/nemustech/tiffany/world/TFCube;->mHitFace:I

    goto :goto_5

    .line 390
    :array_0
    .array-data 0x4
        0x2t 0x0t 0x0t 0x0t
        0x2t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x1t 0x0t 0x0t 0x0t
        0x1t 0x0t 0x0t 0x0t
    .end array-data
.end method
